package com.gitee.liuzhi.demo.juc.thread;

/**
 * @Author liuzhi
 * @Date 2023/9/6 20:39
 * @Version 1.0
 * @Description
 */
public class ThreadDemo {

    public static void main(String[] args) {
        for (int i = 0; i < 100; i++) {
            // 调用子类实例的start()方法启动线程
            new MyThread().start();
        }
    }

    /**
     * 定义Thread的子类
     */
    static class MyThread extends Thread{
        /**
         * 重写run方法
         */
        @Override
        public void run() {
            System.out.println(Thread.currentThread() + " : start");
        }
    }

}
